<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditEmployeesTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_firstName}" for="firstName" />
                    <h:inputText id="firstName" value="#{employeesController.selected.firstName}" title="#{bundle.EditEmployeesTitle_firstName}" />
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_lastName}" for="lastName" />
                    <h:inputText id="lastName" value="#{employeesController.selected.lastName}" title="#{bundle.EditEmployeesTitle_lastName}" />
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_personalEmail}" for="personalEmail" />
                    <h:inputText id="personalEmail" value="#{employeesController.selected.personalEmail}" title="#{bundle.EditEmployeesTitle_personalEmail}" required="true" requiredMessage="#{bundle.EditEmployeesRequiredMessage_personalEmail}"/>
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_businessEmail}" for="businessEmail" />
                    <h:inputText id="businessEmail" value="#{employeesController.selected.businessEmail}" title="#{bundle.EditEmployeesTitle_businessEmail}" required="true" requiredMessage="#{bundle.EditEmployeesRequiredMessage_businessEmail}"/>
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_address}" for="address" />
                    <h:inputTextarea id="address" value="#{employeesController.selected.address}" title="#{bundle.EditEmployeesTitle_address}" required="true" requiredMessage="#{bundle.EditEmployeesRequiredMessage_address}"/>
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_birthDate}" for="birthDate" />
                    <p:calendar value="#{employeesController.selected.birthDate}" id="birthDate" title="#{bundle.EditEmployeesTitle_birthDate}" showOn="button" />
                   
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_nationality}" for="nationality" />
                    <h:inputText id="nationality" value="#{employeesController.selected.nationality}" title="#{bundle.EditEmployeesTitle_nationality}" />
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_maritalStatus}" for="maritalStatus" />
                    <h:selectOneRadio id="maritalStatus" value="#{employeesController.selected.maritalStatus}" title="#{bundle.EditEmployeesTitle_maritalStatus}">
                        <f:selectItem itemValue="Single" itemLabel="Single" />
                        <f:selectItem itemValue="Married" itemLabel="Married" />
                    </h:selectOneRadio>
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_gender}" for="gender" />
                    <h:selectOneRadio id="gender" value="#{employeesController.selected.gender}" title="#{bundle.EditEmployeesTitle_gender}" required="true" requiredMessage="#{bundle.EditEmployeesRequiredMessage_gender}">
                        <f:selectItem itemValue="Male" itemLabel="Male" />
                        <f:selectItem itemValue="Female" itemLabel="Female" />
                    </h:selectOneRadio>
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_skype}" for="skype" />
                    <h:inputText id="skype" value="#{employeesController.selected.skype}" title="#{bundle.EditEmployeesTitle_skype}" required="true" requiredMessage="#{bundle.EditEmployeesRequiredMessage_skype}"/>
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_phoneNumber}" for="phoneNumber" />
                    <h:inputText id="phoneNumber" value="#{employeesController.selected.phoneNumber}" title="#{bundle.EditEmployeesTitle_phoneNumber}" required="true" requiredMessage="#{bundle.EditEmployeesRequiredMessage_phoneNumber}"/>
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_mobile1}" for="mobile1" />
                    <h:inputText id="mobile1" value="#{employeesController.selected.mobile1}" title="#{bundle.EditEmployeesTitle_mobile1}" required="true" requiredMessage="#{bundle.EditEmployeesRequiredMessage_mobile1}"/>
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_mobile2}" for="mobile2" />
                    <h:inputText id="mobile2" value="#{employeesController.selected.mobile2}" title="#{bundle.EditEmployeesTitle_mobile2}" />

                    <h:outputLabel value="#{bundle.EditEmployeesLabel_kinName}" for="kinName" />
                    <h:inputText id="kinName" value="#{employeesController.selected.kinName}" title="#{bundle.EditEmployeesTitle_kinName}" required="true" requiredMessage="#{bundle.EditEmployeesRequiredMessage_kinName}"/>
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_kinRelationship}" for="kinRelationship" />
                    <h:inputText id="kinRelationship" value="#{employeesController.selected.kinRelationship}" title="#{bundle.EditEmployeesTitle_kinRelationship}" />
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_kinPhoneNumber}" for="kinPhoneNumber" />
                    <h:inputText id="kinPhoneNumber" value="#{employeesController.selected.kinPhoneNumber}" title="#{bundle.EditEmployeesTitle_kinPhoneNumber}" />
                    
                    <h:outputLabel value="#{bundle.EditEmployeesLabel_kinEmail}" for="kinEmail" />
                    <h:inputText id="kinEmail" value="#{employeesController.selected.kinEmail}" title="#{bundle.EditEmployeesTitle_kinEmail}" required="true" requiredMessage="#{bundle.EditEmployeesRequiredMessage_kinEmail}"/>
                    
                </h:panelGrid>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <h:commandButton action="#{employeesController.updateProfile}" type="submit" value="#{bundle.EditEmployeesSaveLink}"/>
                <h:commandButton action="viewprofile" value="#{bundle.EditEmployeesViewLink}" type="submit"/>
                <h:panelGrid rendered="#{type == 'admin'}">
                <h:commandButton value="#{bundle.EditEmployeesIndexLink}" action="/index" type="submit" />
                </h:panelGrid>
                <h:panelGrid rendered="#{type == 'user'}">
                <h:commandButton value="#{bundle.EditEmployeesIndexLink}" action="/userhome" type="submit" />
                </h:panelGrid>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
